<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<script type="text/javascript" src="lib/vue-2.6.10.js"></script>
<body>
	<div id="app">
		<h1>{{ title }}</h1>
		<p>{{ money | moneyfilter('￥') }}</p>
		<p>{{ money | moneyfilter }}</p>
		<p>{{ money | moneyfilter('$',1) }}</p>
	</div>
	<script type="text/javascript">
		Vue.filter('moneyfilter',function(vals, str='$', param=2){
			return str+(parseInt(vals).toFixed(param));
		});
		const vm = new Vue({
			el:"#app",
			data:{
				title:'带有参数的模板过滤器',
				money:'1000',
				money2:'2000',
				money3:'3000',
			},
			
		})

		
	</script>
</body>
</html>